Symmetric multiprocessing (SMP) is a computer architecture that provides fast performance by making multiple CPUs available to complete individual processes simultaneously (multiprocessing). Any idle processor can be assigned any task, and additional CPUs can be added to improve performance and handle increased loads. A chip multiprocessor (CMP) includes multiple processor cores on a single chip, which allows more than one thread to be active at a time on the chip. A CMP is SMP implemented on a single integrated circuit. Thread-level parallelism (TLP) is the parallelism inherent in an application that runs multiple threads at once. A goal of CMP is to allow greater utilization of TLP. Parallel programming languages (e.g., OpenMP, TBB, CILK) are used for writing multithreaded applications.
Transactional memory allows multiple threads (cores) to utilize the same memory. Every thread completes its modifications to shared memory without regard for what other threads might be doing, recording every read and write that it makes in a log. Instead of placing the onus on the writer to make sure it does not adversely affect other operations in progress, it is placed on the reader, who after completing an entire transaction verifies that other threads have not concurrently made changes to memory that it accessed in the past. This final operation, in which the changes of a transaction are validated and, if validation is successful, made permanent, is called a commit. A transaction may also abort at any time, causing all of its prior changes to be rolled back or undone. If a transaction cannot be committed due to conflicting changes, it is typically aborted and re-executed from the beginning until it succeeds. This model guarantees a transaction to be executed atomically, consistently, and in isolation, and enables ordinary programmers to write correct and efficient concurrent applications without using locks.
To support software transactional memory or hardware assisted software transactional memory, the memory operations inside a transactional memory region (or simply a transaction) need to be checked for concurrency conflict detection and transaction rollback. Given a transaction boundary, compiler support for software transactional memory needs to automatically insert the special checking code for the transaction. This means that the code generated for the same piece of program text inside or outside a transaction will be different. Since real-world applications often have functions that are called both within and outside transactions, an efficient method to handle function calls inside transactions is needed in order to make transaction practical. Current STM systems either ask users to manually write TM version of the functions to be called inside a transaction, or do not allow function calls inside a transaction.